<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title>上报信息列表</title>
	
	<link rel="stylesheet" type="text/css" href="<%=basePath+Util.SKIN%>/css/right.css">
	<script src="<%=basePath%>/js/jquery-1.7.2.js" type="text/javascript"></script>
    <script type="text/javascript" src="<%=basePath%>/js/check_jquery.js"></script>
    <script src="<%=basePath%>/js/oa.js" type="text/javascript"></script>
    <script type="text/javascript" src="<%=basePath%>/js/dbdialog/lhgdialog.min.js<%=Util.LHGDIALOG%>"></script>
    <script src="<%=basePath%>/js/util.js" type="text/javascript"></script>
	<SCRIPT type="text/javascript">
    var api = frameElement.api, W = api.opener;
	 function selectcheckbox(vv){
		var ids = vv.split(",");
		var zcs = document.getElementsByName('acceptStatus');	
		if(ids!="" && ids.length>0){
			for(i=0; i<zcs.length; i++){
				for(j=0;j<ids.length;j++){
			   		if(zcs[i].value == ids[j]){
			   			zcs[i].checked = true;
			   		}
			   	}
			}
			if(zcs[0].value==1 && zcs[0].checked){
		 		for(i=0; i<zcs.length; i++){			
				   	if(zcs[i].value != 1 ){
				   		zcs[i].disabled=true;
				   		zcs[i].checked = false;
				   	}			   
				}
	 		}
		}			
	 }	
	 
	 function submitForm(id){
	 	document.form1.submit();
	 	var acceptId = W.document.getElementById("acceptType"+id);
	 	var zcs = document.getElementsByName('acceptStatus');
	 	var acceptString = "";
	 	for(i=0; i<zcs.length; i++){
	 		if (zcs[i].checked == true){
	 			var n = document.getElementById(zcs[i].value).value;
	 			acceptString += n+",";
	 		}
	 	}
	 	acceptId.innerHTML = acceptString.substr(0,acceptString.length-1);
	 }
	</SCRIPT>

  </head>
  
  <body onload="selectcheckbox('${doneAcceptType }');">
  	<div class="body-box">
		<div class="map">
			<div class="map_con">
				<b>当前位置：</b> 协同办公 &gt; 信息报送 &gt; 信息设置&gt; 采纳类型设置
			</div>
		</div>
		<div id="container">	
			<form action="<%=basePath%>/oa/oaMsg_updateAcceptType.action?acceptTypeForwardId=1" method="post" name="form1">	
				
			    <table border="0" cellpadding="0" cellspacing="0" class="mytable">
			    	 <tr class="fixedHeaderTr">
			    		<th width="10%">选择</th>
			    		<th width="80%">类型</th>   		
			    	</tr>		    	
		    		<s:iterator value="acceptType" id="obj" status="x">
				    	<tr>
				    		<td align="center">
				    			<input type="checkbox" name="acceptStatus" value="${obj.id }"/>
				    			<input type="hidden" id="${obj.id }" value="${obj.typeName }"/>
				    		</td>			    		
				    		<td align="center" >${obj.typeName }</td>
				    	</tr>
		    		</s:iterator>
				    
			    </table>	
			    <table border="0" cellspacing="0" cellpadding="0"  width="100%" style="float:left; padding-top:15px;padding-bottom:5px;">
						<tr>
							<td align="center"><input type="button" onclick="submitForm(${id })" id="btnSubmit1" class="link_input" value="选 择"/></td>
						</tr>
				</table>	
				<input type="hidden" name="id" value="${id }"/>
				<input type="hidden" name="typeIds" value=""/>
				<input type="hidden" name="typeNames" value=""/> 
			</form>	   
		</div>
		<div class="right_bottom">
			<div style="width:11px;float:left"><img src="<%=basePath%>/images/right_bottom.gif"/></div>
			<div style="width:16px;float:right"><img src="<%=basePath%>/images/right_rbottom.gif"/></div>
		</div>
	</div>
  </body>
<s:if test="%{addOk}"><script type="text/javascript">msgDialog('设置成功！','succ.png');</script></s:if>
</html>
